package com.example.windowdemo.window;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.WindowManager;

import com.example.windowdemo.bean.CallCleanBean;
import com.example.windowdemo.bean.CheckOutBean;

/**
 * @author: njb
 * @date: 2023/7/31 14:50
 * @desc:
 */
public class WindowCreate {
    public static Window createCallCleanWindow(Context context, int layoutResId, CallCleanBean callCleanBean) {
        WindowCallClean window = new WindowCallClean(context);
        //window.setData(callCleanBean);
        window.setFullScreen(true);
        window.setGravity(Gravity.RIGHT);
        window.setSize(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.MATCH_PARENT);
        window.addView(LayoutInflater.from(context).inflate(layoutResId, null));
        return window;
    }

    public static Window createCheckOutWindow(Context context, int layoutResId, CheckOutBean checkOutBean) {
        WindowCheckOut window = new WindowCheckOut(context);
        //window.setData(checkOutBean);
        window.setFullScreen(true);
        window.setGravity(Gravity.CENTER);
        window.setSize(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.MATCH_PARENT);
        window.addView(LayoutInflater.from(context).inflate(layoutResId, null));
        return window;
    }
}
